import requests,re,os,time
print("这是蓝莓做的一个小工具...自己用用就好~不要大范围传播喔！v1.0.1")
time.sleep(0.5)
while 1:
    try:
        response = requests.get("https://world.xiaomawang.com/community/main/compose/" + input("请输入作品id:")).text
        a = re.search(r'.........................................sb3', response).group()
        break
    except:
        print("发生错误.请重试.")
asw = input("您是否已安装迅雷到默认位置(C盘)?(y/n):")
while 1:
    if asw == "y":
        os.popen('''"C:\Program Files (x86)\Thunder Network\Thunder\Program\Thunder.exe" ''' + ("https://community-wscdn.xiaomawang.com/composition/"+a),"r",2)
        break
    elif asw == "n":
        print("https://community-wscdn.xiaomawang.com/composition/"+a)
        print("↑请手动将网址放入下载软件~")
        break
    else:
        print("手误输错了嘛,重新输入下.")
print("期待您的下次使用~现在可以手动关闭了喔.或者等30s自动关闭...")
time.sleep(30)